<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC 
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 
    "http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>

	<constant name="struts.objectFactory" value="spring" />
	<constant name="struts.i18n.encoding" value="UTF-8" />
	<constant name="struts.multipart.maxSize" value="2147483648" />
	<constant name="struts.ognl.allowStaticMethodAccess" value="true" />

	<package name="default" namespace="/" extends="tiles-default">

		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>

				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>

		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>

		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>

		<action name="logout" class="logoutAction"></action>
		<action name="login" class="loginAction" method="login">
			<result type="redirect" name="success">
				${goingToURL}
			</result>
			<result name="input">/index.jsp</result>
			<interceptor-ref name="defaultStack"></interceptor-ref>
		</action>

		<action name="showMain" class="userAction" method="showMain">
			<result>/WEB-INF/pages/main.jsp</result>
		</action>

		<action name="menu" class="userAction" method="userMenu">
			<result>/WEB-INF/pages/menu.jsp</result>
		</action>
		<action name="banner">
			<result>/WEB-INF/pages/top.jsp</result>
		</action>
		<action name="welcome">
			<result>/WEB-INF/pages/welcome.jsp</result>
		</action>
		<action name="footer">
			<result>/WEB-INF/pages/footer.jsp</result>
		</action>
		<action name="center">
			<result>/WEB-INF/pages/center.jsp</result>
		</action>
		<action name="user.password">
			<result type="tiles">user.password</result>
		</action>
		<action name="changepwd" class="userAction" method="changepwd">
			<result name="success" type="chain">
				<param name="namespace">/</param>
				<param name="actionName">user.password</param>
			</result>
		</action>
	</package>


	<package name="role" extends="tiles-default,json-default"
		namespace="/role">
		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor name="aclInterceptor" class="aclInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>
				<interceptor-ref name="aclInterceptor"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>
		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>
		<action name="role" class="roleAction">
			<result type="tiles">role.list</result>
		</action>
		<action name="role.detail" class="roleAction" method="detail">
			<result type="tiles">role.detail</result>
		</action>
		<action name="role.list" class="roleAction" converter="com.jd.tjkw.util.Pager"
			method="list">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.permissions
				</param>
			</result>
		</action>
		<action name="role.delete" class="roleAction" method="delete">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>

		<action name="role.update" class="roleAction" method="update">
			<result name="success" type="redirect">
				/role/role.action
			</result>
			<result name="input" type="chain">
				<param name="namespace">/role</param>
				<!--跳转目标方法  -->
				<param name="actionName">role</param>
			</result>
		</action>

	</package>

	<package name="employee" extends="tiles-default,json-default"
		namespace="/employee">
		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor name="aclInterceptor" class="aclInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>
				<interceptor-ref name="aclInterceptor"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>
		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>
		<action name="employee" class="employeeAction">
			<result type="tiles">employee.list</result>
		</action>
		<action name="employee.info" class="employeeAction" method="employeeInfo">
			<result type="tiles">employee.info</result>
		</action>

		<action name="employee.add">
			<result type="tiles">employee.info</result>
		</action>
		<action name="employeeList" class="employeeAction" converter="com.jd.tjkw.util.Pager"
			method="employeeList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.userInfo
				</param>
			</result>
		</action>
		<action name="employeeDelete" class="employeeAction" method="delete">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>

		<action name="employeeUpdate" class="employeeAction" method="employeeUpdate">
			<result name="success" type="redirect">
				/employee/employee.action
			</result>
			<result name="input" type="chain">
				<param name="namespace">/employee</param>
				<!--跳转目标方法  -->
				<param name="actionName">employee.info</param>
			</result>
		</action>

		<action name="export.all" class="employeeAction" method="exportAll">
			<result type="stream">
				<param name="bufferSize">4096</param>
				<param name="inputName">fileStream</param>
				<param name="contentType">application/vnd.ms-excel</param>
				<param name="contentDisposition">attachment;filename="${fileName}.xls"</param>
			</result>
		</action>
		<action name="export" class="employeeAction" method="export">
			<result type="stream">
				<param name="bufferSize">4096</param>
				<param name="inputName">fileStream</param>
				<param name="contentType">application/vnd.ms-excel</param>
				<param name="contentDisposition">attachment;filename="${fileName}.xls"</param>
			</result>
		</action>
	</package>
	<package name="customerCompany" extends="tiles-default,json-default"
		namespace="/customerCompany">
		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor name="aclInterceptor" class="aclInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>
				<interceptor-ref name="aclInterceptor"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>
		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>
		<action name="customerCompany" class="customerCompanyAction">
			<result type="tiles">customerCompany.list</result>
		</action>
		<action name="customerCompany.info" class="customerCompanyAction"
			method="customerCompanyInfo">
			<result type="tiles">customerCompany.info</result>
		</action>
		<action name="customerCompany.add">
			<result type="tiles">customerCompany.info</result>
		</action>
		<action name="customerCompanyList" class="customerCompanyAction"
			converter="com.jd.ty.util.Pager" method="customerCompanyList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.appreciationLog,
					dataRows.*\.customerOrders,
					dataRows.*\.customers
				</param>
			</result>
		</action>
		<action name="customer.list" class="customerCompanyAction"
			converter="com.jd.ty.util.Pager" method="customerList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.custCompany
				</param>
			</result>
		</action>

		<action name="customerCompanyDelete" class="customerCompanyAction"
			method="delete">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>

		<action name="customerCompanyUpdate" class="customerCompanyAction"
			method="customerCompanyUpdate">
			<result name="success" type="redirect">
				/customerCompany/customerCompany.action
			</result>
			<result name="input" type="chain">
				<param name="namespace">/customerCompany</param>
				<param name="actionName">customerCompany.add</param>
			</result>
		</action>
	</package>
	<package name="order" extends="tiles-default,json-default"
		namespace="/order">
		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor name="aclInterceptor" class="aclInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>
				<interceptor-ref name="aclInterceptor"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>
		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>
		<action name="orders" class="customerOrderAction">
			<result type="tiles">order.list</result>
		</action>
		<action name="order.info" class="customerOrderAction" method="orderInfo">
			<result type="tiles">order.info</result>
		</action>
		<action name="search" class="customerOrderAction">
			<result type="tiles">order.search</result>
		</action>
		<action name="check" class="customerOrderAction" method="check">
			<result type="json">
				<param name="root">pager</param>
			</result>
		</action>
		<action name="delete" class="customerOrderAction" method="deleteOrder">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>	
		<action name="order.list" class="customerOrderAction"
			converter="com.jd.ty.util.Pager" method="getOrderList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
				    dataRows.*\.projectAttrValues,
					dataRows.*\.custCompany.customers,
					dataRows.*\.custCompany.appreciationLog,
					dataRows.*\.custCompany.customerOrders
					
				</param>
			</result>
		</action>
		<action name="company.list" class="customerOrderAction"
			converter="com.jd.ty.util.Pager" method="getCompanyList">
			<result type="json">
				<param name="root">pager.dataRows</param>
			</result>
		</action>
		<action name="customer.list" class="customerOrderAction"
			converter="com.jd.ty.util.Pager" method="getCustomerList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.custCompany
				</param>
			</result>
		</action>
		<action name="log.info" class="customerOrderAction" method="logInfo">
			<result type="tiles">log.info</result>
		</action>
		<action name="log.list" class="customerOrderAction" converter="com.jd.ty.util.Pager"
			method="getLogList">
			<result type="json">
				<param name="root">pager</param>
				<param name="excludeProperties">
					dataRows.*\.customerCompany
				</param>
			</result>
		</action>
		<action name="order.delete" class="customerOrderAction" method="deleteOrder">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>
		<action name="log.delete" class="customerOrderAction" method="deleteLog">
			<result type="json">
				<param name="root">id</param>
			</result>
		</action>
		<action name="log.save" class="customerOrderAction" method="saveLog">
			<result name="success" type="redirect">
				/order/customer.backFromOrder.action
			</result>
			<result name="input" type="chain">
				<param name="namespace">/order</param>
				<param name="actionName">log.info</param>
			</result>
		</action>
		<action name="customer.backFromOrder" class="customerOrderAction"
			method="backFromOrder">
			<result type="tiles">customer.orders</result>
		</action>

		<action name="order.save" class="customerOrderAction" method="saveOrder">
			<result name="success" type="redirect">/order/orders</result>
			<result name="input" type="chain">
				<param name="namespace">/order</param>
				<param name="actionName">order.info</param>
			</result>
		</action>
		<action name="saveCompany" class="customerOrderAction" method="saveCompany">
			<result name="success" type="redirect">
				/order/companys.action
			</result>
			<result name="input" type="chain">
				<param name="namespace">/order</param>
				<param name="actionName">customer.orders</param>
			</result>
		</action>
		<action name="download" class="customerOrderAction" method="downloadTemplate">
			<result type="stream">
				<param name="bufferSize">4096</param>
				<param name="inputName">fileStream</param>
				<param name="contentType">application/vnd.ms-excel</param>
				<param name="contentDisposition">attachment;filename="${fileName}.xls"</param>
			</result>
		</action>
		
		<action name="upload" class="uploadAction">
				<result>/WEB-INF/pages/order/result.jsp</result>
		</action>
		<action name="customer.detail" class="customerCompanyAction"
			method="customerDetail">
			<result type="json">
				<param name="root">customer.detail</param>
			</result>
		</action>
		<action name="employee.detail" class="employeeAction" method="employeeDetail">
			<result type="json">
				<param name="root">employee.detail</param>
			</result>
		</action>
		<action name="employeesByDepartment" class="employeeAction"
			converter="com.jd.tjkw.util.Pager" method="employeesByDepartment">
			<result type="json">
				<param name="root">pager</param>
				<param name="includeProperties">
					dataRows\[\d+\]\.employeeId,
					dataRows\[\d+\]\.employeeName
				</param>
			</result>
		</action>
	</package>


	<package name="dictionary" extends="tiles-default,json-default"
		namespace="/dictionary">
		<interceptors>
			<interceptor name="loginInterceptor" class="loginInterceptor">
			</interceptor>
			<interceptor name="aclInterceptor" class="aclInterceptor">
			</interceptor>
			<interceptor-stack name="loginDefaultStack">
				<interceptor-ref name="loginInterceptor"></interceptor-ref>
				<interceptor-ref name="aclInterceptor"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="loginDefaultStack"></default-interceptor-ref>
		<global-results>
			<result name="login" type="redirect">/index.jsp</result>
		</global-results>
		<action name="main" class="dictionaryAction">
			<result type="tiles">dictionary.main</result>
		</action>

		<action name="list" class="dictionaryAction" converter="com.jd.tjkw.util.Pager"
			method="list">
			<result type="json">
				<param name="root">pager</param>

			</result>
		</action>
		<action name="children" class="dictionaryAction" converter="com.jd.tjkw.util.Pager"
			method="children">
			<result type="json">
				<param name="root">dictionaryList</param>
			</result>
		</action>


		<action name="update" class="dictionaryAction" method="update">
			<result name="success" type="json">
				<param name="root">id</param>
			</result>
			<result name="error" type="json">
				<param name="root">errorMessage</param>
			</result>
		</action>

	</package>
</struts>